<extend name="Public/base" />

<block name="style" >
<style>
.page-content{padding:10px 10px;}
</style>
</block>

<block name="body">

    <!-- 弹窗插件 -->
    <include file="Public:artdialog" />
	<!-- 表单验证插件 -->
    <include file="Public:validform" />

    <form action="{:U('')}" method="post" role="form" class="form-horizontal row-border vform">

        <div class="row">
            <div class="col-md-12">
                <div class="block-web">
                    <div class="header">
                        <h3 class="content-header">添加收款充值</h3>
                    </div>
                    <div class="porlets-content">

                        <div class="form-group">
                            <label class="col-sm-2 control-label"><font class="red">*</font>用户登录帐号</label>
                            <div class="col-sm-9">
                                <input type="text" value="" onblur="searchUser(this);" name="user_name" placeholder="请输入用户登录帐号" 
                                		class="form-control" datatype="*" nullmsg="请输入用户登录帐号" />
                            	<div class="Validform_checktip"></div>
                            </div>
                        </div>
               	
               			<div class="form-group">
                            <label class="col-sm-2 control-label"><font class="red">*</font>用户手机</label>
                            <div class="col-sm-9">
                                <input type="text" value="" name="mobile" id="mobile"  placeholder="请输入用户手机" class="form-control" datatype="*" nullmsg="请输入用户手机" />
                            	<div class="Validform_checktip"></div>
                            </div>
                        </div>
                        
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><font class="red">*</font><strong style="color:red;font-size:13px;">充值金额</strong></label>
                            <div class="col-sm-9">
                                <input type="text"   name="money"  placeholder="请输入充值金额" class="form-control" datatype="*" nullmsg="请输入充值金额" />
                            	<div class="Validform_checktip"></div>
                            </div>
                        </div>
                        
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><font class="red">*</font>收款方式</label>
                            <div class="col-sm-9">
                                <select class="form-control" name="gathering_way" id="gathering_way"  datatype="*" nullmsg="请选择收款方式" >
                                	<option>-请选择-</option>
                                	<option value="1">现金</option>
                                	<option value="2">转账</option>
                                </select>
                                <div class="Validform_checktip"></div>
                            </div>
                        </div>
                        
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><font class="red">*</font>收款金额</label>
                            <div class="col-sm-9">
                                <input type="text"   name="gathering_money" placeholder="请输入收款金额" class="form-control " datatype="*" nullmsg="请输入收款金额" />
                            	<div class="Validform_checktip"></div>
                            </div>
                        </div>
                        
                        
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><font class="red">*</font>收款人</label>
                            <div class="col-sm-9">
                                <input type="text" name="gathering_man" placeholder="请输入收款人" class="form-control" datatype="*" nullmsg="请输入收款人" />
                            	<div class="Validform_checktip"></div>
                            </div>
                        </div>
                        
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><font class="red">*</font>银行流水号/收据号</label>
                            <div class="col-sm-9">
                                <input type="text" name="bank_transaction_id" placeholder="请输入银行流水号/收据号" class="form-control" datatype="*" nullmsg="请输入银行流水号/收据号" />
                            	<div class="Validform_checktip"></div>
                            </div>
                        </div>
                        
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><font class="red">*</font>到款时间</label>
                            <div class="col-sm-9">
                                <input type="text" readonly="readonly" id="gathering_time" name="gathering_time" placeholder="请选择到款时间" class="form-control " datatype="*" nullmsg="请选择到款时间" />
                            	<div class="Validform_checktip"></div>
                            </div>
                        </div>
               
                        <div class="form-group">
                            <label class="col-sm-2 control-label">交易参考</label>
                            <div class="col-sm-9">
                                <textarea class="form-control" name="reference"></textarea>
                            </div>
                        </div>
                        
                        <div class="form-group">
                            <label class="col-sm-2 control-label">备注</label>
                            <div class="col-sm-9">
                                <textarea class="form-control" name="remark"></textarea>
                            </div>
                        </div>
                        <div class="bottom">
                            
                        </div><!--/form-group-->

						<div class="footer">
				            <button class="btn btn-primary btn-success" type="submit">提交</button>
                            <button class="btn btn-default" type="button" onclick="art.dialog.close();">取消</button>
				        </div>

                    </div><!--/porlets-content-->
                </div><!--/block-web-->
            </div>

        </div>



    </form>




</block>

<block name="script">
	<script type="text/javascript" src="/plugins/laydate/laydate.dev.js"></script>
	<script>
	
		laydate({
	        elem: '#gathering_time',
	        festival: true, //显示节日
	        istime: true,
	        format: 'YYYY-MM-DD hh:mm:ss'
	    });
	
		function searchUser(obj){
			
			var _text = $.trim($(obj).val());
			if( _text.length == 0 ){
				return ;	
			}
			
			$.ajax({
				url:"{:U('ajaxGetUserInfo')}",
				data:{'user_name':_text},
				dataType:'json',
				type:'POST',
				success:function(data){
					if(data.status == 0){
						alert('输入的登录帐号不存在,请核对后再试!');
					}else{
						$('#mobile').val(data.data);
					}
				},
				error:function(){
					
				},complete:function(){
					
				}
			});
		}
	</script>
</block>


